import request from '@/utils/request'

// 查询机房列表
export function listRoom(query) {
  return request({
    url: '/machineRoom/list',
    method: 'post',
    data: query
  })
}

// 查询机房详细
export function getRoom(id) {
  return request({
    url: '/machineRoom/' + id,
    method: 'get'
  })
}

// 新增机房
export function addRoom(data) {
  return request({
    url: '/machineRoom',
    method: 'post',
    data: data
  })
}

// 修改机房
export function updateRoom(data) {
  return request({
    url: '/machineRoom',
    method: 'put',
    data: data
  })
}

// 删除机房
export function delRoom(id) {
  return request({
    url: '/machineRoom/' + id,
    method: 'delete'
  })
}

// 导出机房
export function exportRoom(query) {
  return request({
    url: '/machineRoom/export',
    method: 'get',
    params: query
  })
}

// 下载机房导入模板
export function importTemplate() {
  return request({
    url: '/machineRoom/importTemplate',
    method: 'get'
  })
}

// 获取机房
export function machineRoomDictList() {
  return request({
    url: '/machineRoom/dictList',
    method: 'get'
  })
}
